#
# TCSS 422 - Spring 2013
# Paul Ganea, Ralph Feltis, Tarl Hahn
# Team: Something Awesome (We can't remember the exact name)
# 5/2/2013
#

#
# Script for testing the crawler without a GUI.
#
import threading
import datetime
from MultiThreadedCrawler import MultiThreadedCrawler
from SingleThreadedCrawler import SingleThreadedCrawler

crawler = MultiThreadedCrawler(15, 15)
crawler = SingleThreadedCrawler()

crawler.Crawl("http://faculty.washington.edu/gmobus/")

loggingThread = threading.Thread(target=lambda: printLog(), name="Logging Thread")
loggingThread.isDaemon = True
loggingThread.start()



def printLog():
    while True:
        message = crawler.getLog().get(True, None)
        print "[" + datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + "] " + message